﻿@model IEnumerable<OPLWeb.Models.Team>
<div id="content-wrapper">
    <div id="content-main">
        <div class="content-main-gutter">
            <table cellspacing="0" class="fixtures">
                <thead>
                    <tr>
                        <th colspan="8">
                            League table for @Model.First().TeamSeasons.First().Season.SeasonName
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="c1">
                            <h6> Team Name</h6>
                        </td>
                        <td class="c2">
                            <h6>
                                Points</h6>
                        </td>
                        <td class="c2">
                            <h6>
                                Matches</h6>
                        </td>
                        <td class="c2">
                            <h6>
                                Won</h6>
                        </td>
                        <td class="c2">
                            <h6>
                                Lost</h6>
                        </td>
                        <td class="c2">
                            <h6>
                                Tied</h6>
                        </td>
                        <td class="c2">
                            <h6>
                                Average</h6>
                        </td>
                    </tr>
                    @foreach (var item in Model)
                    {
                        <tr>
                            <td class="c1">
                                @item.TeamName
                            </td>
                            <td class="c2" style="font-size: larger">
                                @item.Points
                            </td>
                            <td class="c2" style="font-size: larger">
                                @item.Matches
                            </td>
                            <td class="c2" style="font-size: larger">
                                @item.Won
                            </td>
                            <td class="c2" style="font-size: larger">
                                @item.Lost
                            </td>
                            <td class="c2" style="font-size: larger">
                                @(item.Tied.HasValue ? @item.Tied.Value : 0)
                            </td>
                            <td class="c2" style="font-size: larger">
                                @Convert.ToDecimal(item.Average)
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $('#nav-main > li').each(function () {
            $(this).removeClass('active');
        });
        $('#league').addClass('active');
    });
</script>
